#include "mpiH_Func.hpp"

MPI_Info MPI_Info_no_locks(){
	MPI_Info info;
	MPI_Info_create(&info);
	MPI_Info_set(info, "no_locks", "true");
	return info;
}


namespace mpiDetail {

void calcDisplacements(
	Eigen::ArrayXi& displacements,
	const Eigen::ArrayXi& sizes,
	int nproc
){
	displacements.resize( nproc );
	int dispSum {0};
	for ( int i{0}; i<displacements.size(); ++i ){
		displacements[i] = dispSum;
		dispSum += sizes[i];
	}
}

} // end namespace mpiDetail